<!DOCTYPE html>
<html>
<head>
    <title>使用Call Applay实现继承</title>
    <meta charset="utf-8"/>
    <script>
        function  Person (name, age, love) {
            this.name = name;
            this.age = age;
            this.love = love;
            this.say = function say () {
                document.write("Person姓名：" + name + '<br/>');
            }
        }
        function student(name, age){
            Person.call(this, name, age);
        }
        function teacher(name, love){
            Person.apply(this,[name, love]);
        }
        var per = new Person("zhangping","21","guanxianfei");
        per.say();
        var stu = new student("guanxianfei","22");
        stu.say();
        var tea = new teacher("xiaoguanxianfei","22");
        tea.say();
    </script>
</head>
<body>

</body>
</html>